『Homotopy Type Theory: Univalent Foundations of Mathematics』Chapter 3 Sets and logic
P107-P128
Definition 3.1.1. A type A is a set if for all x, y : A and all p, q : x = y, we have p = q. More precisely, the proposition isSet(A) is defined to be the type
$ \mathrm{isSet}(A) :\equiv \prod_{(x,y:A)}\prod_{(p,q:x=y)} (p = q)